package com.changgou.goods.feign;

import com.changgou.goods.pojo.Category;
import com.changgou.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author tang.qingbo
 * @Date 2020/8/30 23:41
 * @Version 1.0
 */
@FeignClient(name = "goods")//指定调用的服务名
@RequestMapping("/category")
public interface CategoryFeign {
    /**
     * 根据spu表中的category1_id,category2_id,category3_id,循环调用查询分类信息
     *
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<Category> findById(@PathVariable Integer id);
}
